<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	
<ui:composition 
	template="/template/template-padrao.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="titulo">Cadastro</ui:define>	
	
	<ui:define name="corpo">

		<h:form id="participanteForm">
		
			<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
			<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/jquery/jquery.maskMoney.js"></script>
			
			<script type="text/javascript">

				jQuery(function(){
					jQuery('input[id*="nome"]').focus();
					jQuery('input[id*="telefone"]').mask("(99) 9999-9999");
				});
				
			</script>
			
			<script type="text/javascript">
				
				jQuery(document).ready(function(jQuery){
		               jQuery('input[id*="peso"]').maskMoney({symbol:'Kg ', showSymbol:true, thousands:'.', decimal:',', symbolStay: true}); 
		               jQuery('input[id*="meta"]').maskMoney({symbol:'Kg ', showSymbol:true, thousands:'.', decimal:',', symbolStay: true}); 
		               jQuery('input[id*="quantidadeDoacao"]').maskMoney({symbol:'Kg ', showSymbol:true, thousands:'.', decimal:',', symbolStay: true});
		        });
			
			</script>
			
			<br/>
			
			<div class="container" style="width:1150px;">
				
				<h3 align="left">Cadastrar participante</h3>
				<div align="center" style="position: relative;"> <hr align="center" style=" height: 01px;" class="btn-danger sombra"/></div>
				
				<h6>Os campos que contém o " <span style="color: red; font-size: 15px;">*</span> " são obrigatórios.</h6>
				
				<div class="control-group error">
					<table cellspacing="10" width="700px">
						<tr>
							<td>
								<h4><span style="color: red; font-size: 15px;" >*</span> Nome:</h4>
								<p:inputText 
									id="nome" 
									value="#{manterParticipanteBean.participante.nmParticipante}"
									maxlength="100" 
									style="width:220px;"/>
				            </td>
						</tr>
						<tr>
				            <td>
								<h4>Cidade:</h4>
								<p:inputText  
									id="cidade"
									value="#{manterParticipanteBean.participante.cidade}" 
		                        	maxlength="70" 
		                        	style="width:200px;" />
				            </td>
						</tr>
						<tr>
				            <td>
								<h4><span style="color: red; font-size: 15px;" >*</span> Telefone:</h4>
								<p:inputText  
									id="telefone"
									value="#{manterParticipanteBean.participante.telefone}"
									maxlength="14"
									style="width:150px;">
								</p:inputText>
								
				            </td>
						</tr>
						<tr>
				            <td>
								<h4><span style="color: red; font-size: 15px;" >*</span> Email:</h4>
								<p:inputText  
									id="email" 
									value="#{manterParticipanteBean.participante.email}"
		                        	maxlength="80" 
		                        	style="width:170px;" />
				            </td>
						</tr>
						<tr>
				            <td>
								<h4><span style="color: red; font-size: 15px;" >*</span> Peso atual:</h4>
								<p:inputText  
									id="peso"
									value="#{manterParticipanteBean.participante.peso}" 
		                        	maxlength="9" 
		                        	style="width:70px;" />
				            </td>
						</tr>
						<tr>
				            <td>
								<h4>Meta na balança:</h4>
								<p:inputText  
									id="meta"
									value="#{manterParticipanteBean.participante.meta}" 
		                        	maxlength="9" 
		                        	style="width:70px;" />
				            </td>
						</tr>
						<tr>
				            <td>
								<h4>Estimativa de doação:</h4>
								<p:inputText  
									id="quantidadeDoacao"
									value="#{manterParticipanteBean.participante.quantidadeDoacao}" 
		                        	maxlength="9" 
		                        	style="width:70px;" />
				            </td>
						</tr>
					</table>
				</div>
				
				
				<br />
				<div align="left">
					<p:commandButton 
						styleClass="btn btn-danger sombra"
						id="botaoSalvar" 
						value="Cadastrar"
						action="#{manterParticipanteBean.salvarParticipante}" 
						update=":msgSistema, :participanteForm" 
						ajax="false" 
						style="margin-left:5px;"> 
					</p:commandButton>	
					<p:commandButton 
						styleClass="btn btn-danger sombra"
						id="botaoLimpar" 
						value="Limpar"
						action="#{manterParticipanteBean.limparCampos}" 
						update=":msgSistema, :participanteForm" 
						ajax="false" 
						style="margin-left:5px;" />
				</div>
			</div>
		</h:form>
	</ui:define>
</ui:composition>